package com.zxjbyte.yiyi.module.system.api.oss;

import com.zxjbyte.yiyi.module.system.domain.entity.OssConfigPO;
import com.zxjbyte.yiyi.module.system.domain.result.OssConfigResult;
import com.zxjbyte.yiyi.module.system.service.oss.OssConfigService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author zhangxingjia
 * @Date 2023/5/15 15:47
 * @Version: 1.0
 */
@Service
public class OssConfigApiImpl implements OssConfigApi{

    @Resource
    private OssConfigService ossConfigService;

    @Override
    public OssConfigResult getMasterConfigByStorageCode(String storageCode) {
        OssConfigPO ossConfigPo = ossConfigService.getMasterConfigByStorageCode(storageCode);
        OssConfigResult model = new OssConfigResult();
        model.setStorageCode(ossConfigPo.getStorageCode());
        model.setId(ossConfigPo.getId());
        model.setConfig(ossConfigPo.getConfig());
        return model;
    }
}
